package cn.stronglink.assetmanage.business.check.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.SpinnerAdapter;
import android.widget.TextView;

import java.util.List;

import cn.stronglink.assetmanage.R;

/**
 * Created by chencongcong on 2018/6/25.
 */

public class DropDownAdapter extends CommonAdapter<String> implements SpinnerAdapter{
    public DropDownAdapter(Context context,List<String> data) {
        super(context, data, R.layout.spinner_drop_down_layout);
    }
    @Override
    public void convert(ViewHolder holder, String value) {
        TextView ctv = holder.getView(R.id.textView);
        ctv.setText(value);
    }

    @Override
    public View getDropDownView(int position, View convertView, ViewGroup parent) {
        convertView = LayoutInflater.from(mContext).inflate(R.layout.spinner_drop_down_layout, null);
        TextView ctv = (TextView) convertView.findViewById(R.id.textView);
        ctv.setText(getItem(position));
        return convertView;
    }
}
